{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## LASSO"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "np.random.seed(42)\n",
    "x = np.random.uniform(-3.0, 3.0, size=100)\n",
    "X = x.reshape(-1, 1)\n",
    "y = 0.5 * x + 3 + np.random.normal(0, 1, size=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "from sklearn.linear_model import LinearRegression\n",
    "\n",
    "def PolynomialRegression(degree):\n",
    "    return Pipeline([\n",
    "        (\"poly\", PolynomialFeatures(degree=degree)),\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"lin_reg\", LinearRegression())\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "np.random.seed(666)\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import Lasso       #lasso类；  用法和岭回归类似\n",
    "\n",
    "def LassoRegression(degree, alpha):\n",
    "    return Pipeline([\n",
    "        (\"poly\", PolynomialFeatures(degree=degree)),\n",
    "        (\"std_scaler\", StandardScaler()),\n",
    "        (\"lasso_reg\", Lasso(alpha=alpha))\n",
    "    ])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.149608084325997"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.metrics import mean_squared_error\n",
    "lasso1_reg = LassoRegression(20, 0.01)\n",
    "lasso1_reg.fit(X_train, y_train)\n",
    "y1_predict = lasso1_reg.predict(X_test)\n",
    "mean_squared_error(y_test, y1_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_model(model):\n",
    "    X_plot = np.linspace(-3, 3, 100).reshape(100, 1)\n",
    "    y_plot = model.predict(X_plot)\n",
    "\n",
    "    plt.scatter(x, y)\n",
    "    plt.plot(X_plot[:,0], y_plot, color='r')\n",
    "    plt.axis([-3, 3, 0, 6])\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAD8CAYAAAC8TPVwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3de3xU1bn/8c9DCCRcgzUqFxG0Ct6hjR4tta0UK/WKl9NqrdrXT0XrpVZfWqk9Vau10tpzrNqe9mi91lu9UqsVrYL1AqiJoIKAWi1CwIJiEBCQJOv3x0ogkElmz2T27Mt836/XvIDJZGaFzDx77Wc969nmnENERJKhW9QDEBGR4BS0RUQSREFbRCRBFLRFRBJEQVtEJEEUtEVEEiRQ0DazKjN70MwWmNl8Mzsw7IGJiEh73QM+7npgqnPueDPrAfQKcUwiItIBy7a5xsz6Aa8BOzvtxBERiVSQmfbOwArgNjPbF6gDznfOrW37IDObCEwE6N279xdHjhxZ6LGKiHSo4dON1Deso7nN3LKbGYOrKqnqVR7hyIKpq6v70DlXne1xQWbaNcAsYIxz7iUzux74xDn3046+p6amxtXW1uY6ZhGRvI2ZPI36hnXt7h9cVcmLk8ZGMKLcmFmdc64m2+OCLEQuAZY4515q+feD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wo/Fn7/mbWYYor7wv7OufGBXzoPcDjwOX5vlYUsv18ZnYqcATwdZfAYvccfn9poFYMCdeS630IuNs593DU4wmLc67BzJ4FxgMZF5XDqh7Ztc0/jwIWhPE6UTGz8cAlwFHOuU+jHo9kpVYMCdayUHcLMN859z9Rj6fQzKy6tQLNzCqBcXQSM8OqHnkI32awGVgEnOWcqy/4C0XEzN4BegIftdw1K2XVMccANwLVQAMwxzl3aLSj6hozOwz4DZtbMVwd8ZAKyszuBb6Gb136b+By59wtkQ6qQMzsy8DzwBv4mAJwqXPub9GNqnDMbB/gDvx7sxtwv3Puyg4fn8AzexGRkqUdkSIiCaKgLSKSIAraIiIJoqAtIpIgCtoiIgmioC0ikiAK2iIiCfL/ARCP8WFfA8o8AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_model(lasso1_reg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.1213911351818648"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lasso2_reg = LassoRegression(20, 0.1)        #这个alpha 多次试验确定大致量级\n",
    "lasso2_reg.fit(X_train, y_train)\n",
    "y2_predict = lasso2_reg.predict(X_test)\n",
    "mean_squared_error(y_test, y2_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAD8CAYAAAC8TPVwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3de3RV9Z338fe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AABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_model(lasso2_reg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.8408939659515595"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lasso3_reg = LassoRegression(20, 1)\n",
    "lasso3_reg.fit(X_train, y_train)\n",
    "y3_predict = lasso3_reg.predict(X_test)\n",
    "mean_squared_error(y_test, y3_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAD8CAYAAAC8TPVwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAYYklEQVR4nO3dfYxcZ3XH8d/xZkM2JmSF2JZkiUVQkVPEi01GKZWrCgwl4UWQ0lYU0QqplSz+oA2opJiiFkFFMbLEiyr+wCq0IAIFkRBVTYuhMoESNYHd2EDAdoUohWygMW0XEuzC2j79Y3fNendm7p2Z+9zn5X4/UhTv7N2dZ3bmnnvuec59rrm7AAB52BZ7AACA+gjaAJARgjYAZISgDQAZIWgDQEYI2gCQkVpB28xmzexTZnbCzI6b2a+GHhgAYKtLam73PkmfcfffNrNLJV0ecEwAgAGs6uIaM3ucpK9KeopzJQ4ARFUn036KpFOS/tbMniVpUdIt7v6TjRuZ2T5J+yRp+/bt11933XVNjxUABlo+vaKl5TM6vyG33Gam+dkZzV4+HXFk9SwuLv7Q3eeqtquTafck3Stpj7vfZ2bvk/Rjd//zQT/T6/V8YWFh1DED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d+zxNM3M5tY70MxsRtILNCRmhuoeuV2rywyel/Sfkl7r7kuNP1EkZvYtSY+R9N9rD91bWHfMb0r6a0lzkpYlHXP3G+OOajJm9mJJ79XPl2J4R+QhNcrMPi7puVpduvS/JL3V3T8YdVANMbNfk/Svkr6u1ZgiSX/m7v8Ub1TNMbNnSvqwVj+b2yR90t3fPnD7DM/sAaCzuCISADJC0AaAjBC0ASAjBG0AyAhBGwAyQtAGgIwQtAEgI/8PZcW2E9el9+MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_model(lasso3_reg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
